import Vue from 'vue'
import Router from 'vue-router'
import Login from '../pages/Login.vue'
import Home from '../pages/Home.vue'
import DiagnosisRecord from '../pages/DiagnosisRecord.vue'
import CaiGouRK from '../pages/CaiGouRK.vue'
import ChargeRecord from '../pages/ChargeRecord.vue'
import CommonBank from '../pages/CommonBank.vue'
import DrugMaintenance from '../pages/DrugMaintenance.vue'
import KuCunYJ from '../pages/KuCunYJ.vue'
import RuKuSH from '../pages/RuKuSH.vue'
import WuLiaoList from '../pages/WuLiaoList.vue'
import WuLiaoRecord from '../pages/WuLiaoRecord.vue'
import YaoPinDJ from '../pages/YaoPinDJ.vue'
import ZhenLiaoZN from '../pages/ZhenLiaoZN.vue'
import ZhongyiBank from '../pages/ZhongyiBank.vue'
import XiTongXXB from '../pages/XiTongXXB.vue'
import Children1 from '../pages/Children1.vue'
import Children2 from '../pages/Children2.vue'
import HZBingLi from '../pages/HZBingLi.vue'
import DingDanYM from '../pages/DingDanYM.vue'
// 诊所管理模块
import YiShiXX from '../pages/clinic/Doctor.vue'
import ClinicAdmin from '../pages/clinic/ClinicAdmin.vue'
import Clinic from '../pages/clinic/Clinic.vue'

// 管理员模块
import User from '../pages/admin/User.vue'
import Role from '../pages/admin/Role.vue'
import Admin from '../pages/admin/Admin.vue'
import Menu from '../pages/admin/Menu.vue'
// 供应商模块
import SupplierInsertOrder from '../pages/supplier/SupplierInsertOrder.vue'
import SupplierList from '../pages/supplier/SupplierList.vue'
import SupplierOutboundOrder from '../pages/supplier/SupplierOutboundOrder.vue'


import GuanLiYuan from '../pages/GuanLiYuan.vue'

Vue.use(Router);


const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: '登录页',
      component: Login
    },
    {
      path:'/GuanLiYuan',
      name:'管理员登录',
      component:GuanLiYuan,
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: 'DiagnosisRecord',
          name: '诊断记录',
          component: DiagnosisRecord,
        },
        {
          path:'HZBingLi',
          name:'患者病历',
          component:HZBingLi
        },
        {
          path: 'CaiGouRK',
          name: '采购入库',
          component: CaiGouRK,
        },
        {
          path: 'ChargeRecord',
          name: '收费记录',
          component: ChargeRecord,
        },
        {
          path: 'CommonBank',
          name: '常见疾病知识库',
          component: CommonBank,
        },
        {
          path: 'DrugMaintenance',
          name: '药品信息维护',
          component: DrugMaintenance,
        },
        {
          path: 'KuCunYJ',
          name: '库存预警',
          component: KuCunYJ,
          children: [
            {
              path: 'Children1',
              name: '有效期预警',
              component: Children1,
            }, {
              path: 'Children2',
              name: '仓库存储预警',
              component: Children2,
            },
          ]
        },
        {
          path: 'RuKuSH',
          name: '入库审核',
          component: RuKuSH,
        },
        {
          path: 'WuLiaoList',
          name: '物料信息列表',
          component: WuLiaoList,
        },
        {
          path: 'WuLiaoRecord',
          name: '物料领取记录',
          component: WuLiaoRecord,
        },
        {
          path: 'YaoPinDJ',
          name: '药品调价',
          component: YaoPinDJ,
        },
        {
          path:'DingDanYM',
          name:'订单页面',
          component:DingDanYM
        },
        {
          path: 'ZhenLiaoZN',
          name: '诊疗指南',
          component: ZhenLiaoZN,
        },
        {
          path: 'ZhongyiBank',
          name: '中医知识库',
          component: ZhongyiBank,
        },
        {
          path: 'XiTongXXB',
          name: '系统信息表',
          component: XiTongXXB,
        },
        {
          path:'YiShiXX',
          name:'医师信息',
          component:YiShiXX,
        },
        {
          path:'ClinicAdmin',
          name:'诊所用户信息',
          component:ClinicAdmin,
        },
        {
          path:'Clinic',
          name:'诊所信息',
          component:Clinic,
        }
        ,{
          path:'User',
          name:'用户管理',
          component:User,
        },
        {
          path:'Role',
          name:'角色管理',
          component:Role,
        },
        {
          path:'Menu',
          name:'菜单权限管理',
          component:Menu,
        },{
          path:'Admin',
          name:'供应商管理',
          component:Admin,
        },{
          path:'SupplierInsertOrder',
          name:'订单入库',
          component:SupplierInsertOrder,
        },{
          path:'SupplierList',
          name:'供应商列表查询',
          component:SupplierList,
        },{
          path:'SupplierOutboundOrder',
          name:'订单出库',
          component:SupplierOutboundOrder,
        }
      
        // ]
        // }
      ]
    }
  ]
  
})

